<article id="wikiArticle">
<div></div>
<h2 id="Summary" name="Summary">Summary</h2>
<p>The <code><strong>WeakSet</strong></code><strong><code>.prototype</code></strong> property represents the prototype for the <a href="Reference/Global_Objects/WeakSet" title="WeakSet 对象允许你将弱保持对象存储在一个集合中。"><code>WeakSet</code></a> constructor.</p>
<div><table class="standard-table">
<thead>
<tr>
<th class="header" colspan="2"><code>WeakSet.prototype</code> 属性的属性特性：</th>
</tr>
</thead>
<tbody>
<tr>
<td>writable</td>
<td>false</td>
</tr>
<tr>
<td>enumerable</td>
<td>false</td>
</tr>
<tr>
<td>configurable</td>
<td>false</td>
</tr>
</tbody>
</table></div>
<h2 id="Description" name="Description">Description</h2>
<p><a href="Reference/Global_Objects/WeakSet" title="WeakSet 对象允许你将弱保持对象存储在一个集合中。"><code>WeakSet</code></a> instances inherit from <a href="Reference/Global_Objects/WeakSet/prototype" title="The WeakSet.prototype property represents the prototype for the WeakSet constructor."><code>WeakSet.prototype</code></a>. You can use the constructor's prototype object to add properties or methods to all <code>WeakSet</code> instances.</p>
<h2 id="Properties">Properties</h2>
<dl>
<dt><code>WeakSet.prototype.constructor</code></dt>
<dd>返回构造函数即 <a href="Reference/Global_Objects/WeakSet" title="WeakSet 对象允许你将弱保持对象存储在一个集合中。"><code>WeakSet</code></a> 本身.</dd>
</dl>
<h2 id="Methods">Methods</h2>
<dl>
<dt><a href="Reference/Global_Objects/WeakSet/add" title="add() 方法在 WeakSet 对象的最后一个元素后添加新的对象。"><code>WeakSet.prototype.add(value)</code></a></dt>
<dd> 在<span style="line-height: 1.5;">该 </span><code style="font-size: 14px;">WeakSet</code><span style="line-height: 1.5;"> 对象中添加一个新元素 <code>value</code>.</span></dd>
<dt><a href="Reference/Global_Objects/WeakSet/clear" title="clear() 方法用于删除 WeakSet 对象的所有元素，但是已经不是 ECMAScript 的一部分了。"><code>WeakSet.prototype.clear()</code></a></dt>
<dd>清空该 <code>WeakSet</code> 对象中的所有元素.</dd>
<dt><a href="Reference/Global_Objects/WeakSet/delete" title="delete() 方法从 WeakSet 对象中移除指定的元素。"><code>WeakSet.prototype.delete(value)</code></a></dt>
<dd>从<span style="line-height: 1.5;">该 </span><code style="font-size: 14px;">WeakSet</code><span style="line-height: 1.5;"> 对象中删除</span><span style="line-height: 1.5;"> </span><code style="font-size: 14px;">value </code><span style="line-height: 1.5;">这个元素, 之后 </span><code style="font-size: 14px;">WeakSet.prototype.has(value)</code><span style="line-height: 1.5;"> 方法便会返回 </span><code style="font-size: 14px;">false</code><span style="line-height: 1.5;">.</span></dd>
<dt><a href="Reference/Global_Objects/WeakSet/has" title="has() 方法根据 WeakSet 是否存在相应对象返回布尔值。"><code>WeakSet.prototype.has(value)</code></a></dt>
<dd>返回一个布尔值,  表示给定的值 <code>value</code> 是否存在于这个 <code>WeakSet</code> 中.</dd>
</dl>
<h2 id="Specifications">Specifications</h2>
<table class="standard-table">
<tbody>
<tr>
<th scope="col">Specification</th>
<th scope="col">Status</th>
<th scope="col">Comment</th>
</tr>
<tr>
<td><a class="external" href="https://www.ecma-international.org/ecma-262/6.0/#sec-weakset.prototype" hreflang="en" lang="en" rel="noopener">ECMAScript 2015 (6th Edition, ECMA-262)<br/><small lang="zh-CN">WeakSet.prototype</small></a></td>
<td><span class="spec-Standard">Standard</span></td>
<td>Initial definition.</td>
</tr>
</tbody>
</table>
<h2 id="Browser_compatibility">Browser compatibility</h2>
<p></p><div class="blockIndicator warning"><strong><a class="external" href="https://github.com/mdn/browser-compat-data" rel="noopener">We're converting our compatibility data into a machine-readable JSON format</a></strong>.
            This compatibility table still uses the old format,
            because we haven't yet converted the data it contains.
            <strong><a class="new" href="/zh-CN/docs/MDN/Contribute/Structures/Compatibility_tables" rel="nofollow">Find out how you can help!</a></strong></div>
<div class="htab">
<a id="AutoCompatibilityTable" name="AutoCompatibilityTable"></a>
<ul>
<li class="selected"><a>Desktop</a></li>
<li><a>Mobile</a></li>
</ul>
</div><p></p>
<div id="compat-desktop">
<table class="compat-table">
<tbody>
<tr>
<th>Feature</th>
<th>Chrome</th>
<th>Firefox (Gecko)</th>
<th>Internet Explorer</th>
<th>Opera</th>
<th>Safari</th>
</tr>
<tr>
<td>Basic support</td>
<td><span style="color: #888;" title="Please update this with the earliest version of support.">(Yes)</span></td>
<td><span style="color: #f00;">未实现</span> <a class="external" href="https://bugzilla.mozilla.org/show_bug.cgi?id=792439" rel="noopener" title="FIXED: Implement ES6 WeakSet">bug 792439</a></td>
<td><span style="color: #f00;">未实现</span></td>
<td><span style="color: #f00;">未实现</span></td>
<td><span style="color: #f00;">未实现</span></td>
</tr>
</tbody>
</table>
</div>
<div id="compat-mobile">
<table class="compat-table">
<tbody>
<tr>
<th>Feature</th>
<th>Android</th>
<th>Firefox Mobile (Gecko)</th>
<th>IE Mobile</th>
<th>Opera Mobile</th>
<th>Safari Mobile</th>
</tr>
<tr>
<td>Basic support</td>
<td><span style="color: #f00;">未实现</span></td>
<td><span style="color: #f00;">未实现</span> <a class="external" href="https://bugzilla.mozilla.org/show_bug.cgi?id=792439" rel="noopener" title="FIXED: Implement ES6 WeakSet">bug 792439</a></td>
<td><span style="color: #f00;">未实现</span></td>
<td><span style="color: #f00;">未实现</span></td>
<td><span style="color: #f00;">未实现</span></td>
</tr>
</tbody>
</table>
</div>
<h3 id="Chrome-specific_notes">Chrome-specific notes</h3>
<ul>
<li>This feature is available behind a preference. In <code style="font-size: 14px;">chrome://flags</code>, activate the entry “Enable Experimental JavaScript”.</li>
</ul>
<h2 id="See_also">See also</h2>
<ul>
<li><a href="Reference/Global_Objects/Set/prototype" title="Set.prototype属性表示Set构造器的原型。"><code>Set.prototype</code></a></li>
<li><a href="Reference/Global_Objects/WeakMap/prototype" title="WeakMap.prototype属性表现为 WeakMap的构造器。"><code>WeakMap.prototype</code></a></li>
</ul>
</article>